package Dao;

import Model.Student;
import Model.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentDao {
    @Select("select * from student")
    List<Student> findAll();
    @Insert("insert into student values(null,#{name},#{sex},#{age},#{major},#{time})")
    void saveStudent(Student student);
    @Delete("delete from student where id=#{id}")
    void deleteStudent(int id);
    @Update("update student set name=#{name},sex=#{sex},age=#{age},major=#{major},time=#{time}where id=#{id}")
    void updateStudent(Student student);
    @Select("select * from user where sname=#{sname} and password=#{password}")
    User login(@Param("sname") String sname, @Param("password") String password);
}
